home *** CD-ROM | disk | FTP | other *** search
- ******************** JOBSINDX COMMAND FILE ********************
- * Indexes the costbase on job numbers to Jobs.NDX.
- * The method of indexing here allows us to use the index to help
- * find job numbers for the Job Costs command files, but allows us to
- * do so without having to index the Costbase every time we add a bill.
- * The strategy is: before we index the Costbase on job numbers,
- * we first store the number of the last record in a record with a job
- * number of zero. When the file is indexed, this record is at the top
- * of the indexed file ($Jobs) so that we can find it whenever we want to.
- **************************************************************************
-
- USE Costbase
- GO BOTTOM
- STORE STR(#,5) TO Temp
- GO TOP
- IF Job:Nmbr = 0
- REPLACE Name WITH Temp
- ELSE
- DO WHILE !(Code) <> 'H'
- ? "Uh, Oh--trouble. Don't touch anything"
- ACCEPT 'and call Hal.' To Code
- ENDDO
- ENDIF
-
- DELETE FILE $Jobs.NDX
- ERASE
- @5,0 SAY 'There are ' + Temp + ' records to index.'
- SET TALK ON
- INDEX ON Job:Nmbr TO $Jobs
- SET TALK OFF
-
- RELEASE Temp
- RETURN
-